﻿using UnityEngine;
using System.Collections;

public class builder_Cloud : MonoBehaviour {

	//生成云的时间间隔
	public float ShengChengTime = 0;
	Vector3 vec = Vector3.zero;
	GameObject Cloud = null;

	void Start () {

        Cloud = Resources.Load<GameObject>(SampleXml.prefabPath[6].ToString());
        this.Invoke("CreatCloud", ShengChengTime);
	}
	
    //生成云朵
    void CreatCloud()
    {
        ShengChengTime = Random.Range(30, 41);
        vec = new Vector3(Random.Range(-6, 7), Cloud.transform.position.y, 0);
        Instantiate(Cloud, vec, Quaternion.identity);
        this.Invoke("CreatCloud", ShengChengTime);
    }
}
